/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Main container - responsive height based on environment */
.container {
    width: 100%;
    height: 450px; /* Default iframe height */
    max-width: 800px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Adjust height for full browser view */
@media (min-height: 600px) {
    .container {
        height: 90vh;
        max-height: 700px;
    }
}

/* Ukulele container */
.ukulele-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* Ukulele styling */
.ukulele {
    position: relative;
    display: flex;
    align-items: center;
}

/* Ukulele neck */
.neck {
    width: 300px;
    height: 120px;
    background: linear-gradient(to bottom, #8B4513, #A0522D);
    border-radius: 8px;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-right: 10px;
}

/* Frets */
.fret {
    position: absolute;
    width: 3px;
    height: 100%;
    background: #C0C0C0;
    border-radius: 1px;
}

.fret-0 { left: 0; }
.fret-1 { left: 60px; }
.fret-2 { left: 120px; }
.fret-3 { left: 180px; }
.fret-4 { left: 240px; }

/* Strings */
.string {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #FFD700;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.string-1 { top: 20px; }
.string-2 { top: 40px; }
.string-3 { top: 60px; }
.string-4 { top: 80px; }

/* Finger positions */
.finger {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #FF6B6B, #FF5252);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    cursor: pointer;
}

.finger.active {
    opacity: 1;
    transform: scale(1);
    animation: pulse 0.6s ease-in-out;
}

/* Chord-specific finger positions */
.finger-c-3 { top: 50px; left: 170px; } /* C chord: 3rd fret, E string */
.finger-f-1 { top: 30px; left: 50px; }  /* F chord: 1st fret, C string */
.finger-f-2 { top: 70px; left: 50px; }  /* F chord: 1st fret, A string */
.finger-am-2 { top: 70px; left: 110px; } /* Am chord: 2nd fret, A string */

/* Ukulele body */
.body {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #DEB887, #CD853F);
    border-radius: 40px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sound-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #2C1810;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Controls container */
.controls-container {
    padding: 15px 10px 5px;
}

/* Chord information */
.chord-info {
    text-align: center;
    margin-bottom: 15px;
}

.current-chord {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.chord-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.3;
}

/* Chord buttons */
.chord-buttons {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.chord-btn {
    flex: 1;
    min-height: 60px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.chord-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chord-btn.active {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    animation: buttonPulse 0.6s ease-in-out;
}

.chord-name {
    font-size: 1.4em;
    line-height: 1;
}

.chord-type {
    font-size: 0.8em;
    opacity: 0.9;
    margin-top: 2px;
}

/* Strum effect */
.strum-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    pointer-events: none;
    border-radius: 15px;
}

.strum-effect.active {
    animation: strumWave 0.8s ease-out;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes buttonPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes strumWave {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.2); }
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .neck {
        width: 250px;
        height: 100px;
    }
    
    .body {
        width: 60px;
        height: 100px;
    }
    
    .chord-btn {
        min-height: 50px;
    }
    
    .chord-name {
        font-size: 1.2em;
    }
    
    .current-chord {
        font-size: 1.3em;
    }
    
    /* Adjust finger positions for smaller neck */
    .finger-c-3 { left: 140px; }
    .finger-f-1 { left: 40px; }
    .finger-f-2 { left: 40px; }
    .finger-am-2 { left: 90px; }
}

/* Touch-friendly targets */
@media (pointer: coarse) {
    .chord-btn {
        min-height: 70px;
    }
    
    .finger {
        width: 24px;
        height: 24px;
    }
}